<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@page import="java.util.List"%>
<%@include file='head.jsp'%>

<body>
<div id="page" class="shell">
	<%@include file="menu_admin.jsp" %>
	<fmt:formatDate value="${dataAtual}" pattern="dd/MM/yyyy" var="hoje"/>	
	<!-- Main -->
	<div id="main">
		<h2>Consertos Efetivados em <c:out value="${hoje}"/></h2>
		
		<table>
			<thead>
				<tr>
					<th>Num. Conserto</th>
					<th>Cliente</th>
					<th>Produto</th>
                                        <th>Data Entrada</th>
					<th>Data de Entrega</th>
					<th>Valor</th>
				</tr>
			</thead>
			<tbody>
				<tr>
					<c:if test="${listaConserto != null}">
                                            <c:forEach var="conserto" items="${listaConserto}">
                                                <tr>
                                                    <td><c:out value="${conserto.idConserto}" /></td>
                                                    <td><c:out value="${conserto.pedido.cliente.nome}" /></td>
                                                    <td><c:out value="${conserto.pedido.produto.nome}" /></td>
                                                    <fmt:formatDate value="${conserto.pedido.dataEntrada}" pattern="dd/MM/yyyy" var="dataEFormatada"/>
                                                    <td><c:out value="${dataEFormatada}" /></td>
                                                    <fmt:formatDate value="${conserto.dataEntrega}" pattern="dd/MM/yyyy" var="dataFormatada"/>
                                                    <td><c:out value="${dataFormatada}" /></td>
                                                    <fmt:formatNumber value="${conserto.pedido.valor}" type="currency" var="valorFormatado"/>
                                                    <td><c:out value="${valorFormatado}" /></td>
                                                </tr>
                                             </c:forEach>
                                         </c:if>
				</tr>
			</tbody>
		</table>
		
	</div>
	<!-- END Main -->

	<%@include file="footer.jsp" %>
	
	<br />
</div>
</body>
</html>